package com.gsh.controller;

import com.alibaba.fastjson.JSONObject;
import com.gsh.pojo.Abnormal;
import com.gsh.service.IAbnormalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class AbnormalController {

    @Autowired
    IAbnormalService abnormalService;

    /**
     * excel表导入
     */


    /**
     *查询
     */
    @RequestMapping("queryAB")
    public String query(@RequestParam(name = "PageNumber") int pageNumber,
                        @RequestParam(name="PageSize") int pageSize){
        List<Abnormal> abnormals = abnormalService.queryAbnormal(pageNumber,pageSize);
        return JSONObject.toJSONString(abnormals);
    }
}
